{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "dd7cef332a62b2c3",
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "source": [
    "# prompt template"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "175bf20b2fefb90d",
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "source": [
    "faiss-cpu 向量数据库\n",
    "qianfan 是百度千帆大模型平台"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-05-18T02:46:07.117569Z",
     "start_time": "2024-05-18T02:46:04.326110Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    }
   ],
   "source": [
    "%pip install openai langchain tiktoken faiss-cpu qianfan chromadb -q"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "449675d651cb360e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-05-18T02:38:41.811701Z",
     "start_time": "2024-05-18T02:38:35.464544Z"
    },
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [],
   "source": [
    "#设置密码\n",
    "import os\n",
    "import getpass\n",
    "\n",
    "os.environ[\"QIANFAN_AK\"] = getpass.getpass(\"输入千帆平台的app key\")\n",
    "os.environ[\"QIANFAN_SK\"] = getpass.getpass(\"输入千帆平台的secret key\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f7d15d2b415e5716",
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [],
   "source": [
    "#提示词的模板\n",
    "from langchain import PromptTemplate\n",
    "from langchain.llms.baidu_qianfan_endpoint import QianfanLLMEndpoint\n",
    "\n",
    "llm = QianfanLLMEndpoint(model = \"Qianfan-Chinese-Llama-2-13B\")\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c10d90d2487eb8e6",
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8161494f5693cc52",
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
